# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=nimbostratus
pkgver=54.c7c206f
pkgrel=5
groups=('blackarch' 'blackarch-fingerprint' 'blackarch-exploitation'
        'blackarch-fuzzer')
pkgdesc='Tools for fingerprintinging and exploiting Amazon cloud infrastructures.'
url='https://github.com/andresriancho/nimbostratus'
arch=('any')
license=('GPL3')
depends=('python2' 'python2-nose' 'python2-boto' 'python2-requests'
         'python2-httpretty' 'python2-six')
makedepends=('git')
source=("git+https://github.com/andresriancho/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin/"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm LICENSE README.md

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

